package com.bw.module_merchant.activity

import android.graphics.Color
import android.os.Bundle
import androidx.fragment.app.Fragment
import com.example.lib_common.view.view.BaseMvvmActivity
import com.example.module_merchant.R
import com.example.module_merchant.databinding.ActivityEnterpriseApproveBinding


import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class EnterpriseApproveActivity : BaseMvvmActivity<ActivityEnterpriseApproveBinding>() {


    override fun initViews() {



        binding.merchantApproveTrue.setOnClickListener { v ->
            binding.merchantApproveTrue.setTextColor(Color.parseColor("#007660"))
            binding.merchantApproveTrueInd.setBackgroundResource(R.drawable.ind_select)


            binding.merchantApproveFalse.setTextColor(Color.parseColor("#000000"))
            binding.merchantApproveFalseInd.setBackgroundResource(R.drawable.ind_unselect)
            replaceFragment(ApproveTrueFragment())
        }

        binding.merchantApproveFalse.setOnClickListener { v ->
            binding.merchantApproveTrue.setTextColor(Color.parseColor("#000000"))
            binding.merchantApproveTrueInd.setBackgroundResource(R.drawable.ind_unselect)


            binding.merchantApproveFalse.setTextColor(Color.parseColor("#007660"))
            binding.merchantApproveFalseInd.setBackgroundResource(R.drawable.ind_select)
            replaceFragment(ApproveFalseFragment())
        }

    }

    override fun getActivityState(state: Bundle) {
        TODO("Not yet implemented")
    }

    override fun saveActivityState(outState: Bundle) {
        TODO("Not yet implemented")
    }

    private fun replaceFragment(fragment: Fragment) {
        supportFragmentManager.beginTransaction()
            .replace(R.id.approveFragment, fragment)
            .commit()
    }

    override fun loadData() {
        super.loadData()

    }

    override fun getLayoutId(): Int =R.layout.activity_enterprise_approve

}